package top.fullj.win32;

import com.sun.jna.Structure;

/**
 * https://docs.microsoft.com/zh-cn/windows/win32/api/winbase/ns-winbase-dcb
 *
 * @author bruce.wu
 * @since 2019/11/14 9:20
 */
@SuppressWarnings("SpellCheckingInspection")
@Structure.FieldOrder({
        "DCBlength",
        "BaudRate",
        "dwFlags",
        "wReserved",
        "XonLim",
        "XoffLim",
        "ByteSize",
        "Parity",
        "StopBits",
        "XonChar",
        "XoffChar",
        "ErrorChar",
        "EofChar",
        "EvtChar",
        "wReserved1",
})
public class DCB extends Structure {

    public int DCBlength;
    public int BaudRate;
    /**
     *   DWORD fBinary : 1;
     *   DWORD fParity : 1;
     *   DWORD fOutxCtsFlow : 1;
     *   DWORD fOutxDsrFlow : 1;
     *   DWORD fDtrControl : 2;
     *   DWORD fDsrSensitivity : 1;
     *   DWORD fTXContinueOnXoff : 1;
     *   DWORD fOutX : 1;
     *   DWORD fInX : 1;
     *   DWORD fErrorChar : 1;
     *   DWORD fNull : 1;
     *   DWORD fRtsControl : 2;
     *   DWORD fAbortOnError : 1;
     *   DWORD fDummy2 : 17;
     */
    public int dwFlags;
    public short wReserved;
    public short XonLim;
    public short XoffLim;
    public byte ByteSize;
    public byte Parity;
    public byte StopBits;
    public byte XonChar;
    public byte XoffChar;
    public byte ErrorChar;
    public byte EofChar;
    public byte EvtChar;
    public short wReserved1;

}
